from sqlalchemy import Float, String
from sqlalchemy.orm import DeclarativeBase, mapped_column, Mapped


class Base(DeclarativeBase):
    pass


class Book(Base):
    __tablename__ = "Book"

    id: Mapped[int] = mapped_column("book_id", primary_key=True)
    book_name: Mapped[str] = mapped_column(String(50), nullable=False)
    price: Mapped[float] = mapped_column(Float, nullable=False)

    def __repr__(self):
        return f"<Book(id={self.id}, book_name={self.book_name}, price={self.price})>"

    ""
